import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'
import Footer from '@/components/footer.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // }
  {
    path: '/register',
    name: 'Register',
    components: {
      default: () => import(/* webpackChunkName: "user" */ '../views/register/index.vue')
    }
  },
  {
    path: '/login',
    name: 'Login',
    components: {
      default: () => import(/* webpackChunkName: "user" */ '../views/login/index.vue')
    }
  },
  {
    path: '/detail',
    name: 'Detail',
    components: {
      default: () => import(/* webpackChunkName: "pro" */ '../views/detail/index.vue')
    }
  },
  {
    path: '/',
    name: 'Home',
    alias: '/home',
    components: {
      default: Home,
      foot: Footer
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
